package com.zjfhw.ui;
 

import com.zjfhw.utils.AutoBackgroud;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;
import android.widget.LinearLayout;

public class WelcomeActivity extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) { 
		super.onCreate(savedInstanceState);
		
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		this.setContentView(R.layout.welcome);
		LinearLayout view = (LinearLayout) findViewById(R.id.layout); 
		AutoBackgroud.AutoBackground(this, view, R.drawable.vv, R.drawable.hh);
		
		ImageView iv=(ImageView)this.findViewById(R.id.logo_bg);
		AlphaAnimation aa=new AlphaAnimation(0.1f,1.0f);
		aa.setDuration(3000);
		iv.startAnimation(aa);
		aa.setAnimationListener(new AnimationListener()
		{

			@Override
			public void onAnimationEnd(Animation arg0) { 
				Intent it=new Intent(WelcomeActivity.this,Login.class);
				startActivity(it);
				finish();
			}

			@Override
			public void onAnimationRepeat(Animation animation) {
			  
			}

			@Override
			public void onAnimationStart(Animation animation) {
			 
			}
			
		}
		);
	
	}

}
